﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace _201206QuanLyBanHang.ChucNang
{
    class BLL_Diple
    {
        DataConn da;
        public BLL_Diple()
        {
            da = new DataConn();
        }
         public DataSet getdiple(string strsql)
        {
            return da.ExectueQueryDataset(strsql, CommandType.Text, null);
        }
         public bool insertdiple(ref string err, int Madl, string Tendl, string GhiChu)
        {
            return da.MyExecuteNonQuery("Pro_Insert_dmdiple", CommandType.StoredProcedure, ref err, new SqlParameter("@madiple", Madl), new SqlParameter("@tendiple", Tendl), new SqlParameter("@ghichu", GhiChu));
        }
        public bool deletediple(ref string err, int Madl)
        {
            return da.MyExecuteNonQuery("Pro_Delete_DMdiple", CommandType.StoredProcedure, ref err, new SqlParameter("@Madiple", Madl));
        }
        public bool updatediple(ref string err, int Madl, string Tendl, DateTime ngaydl, string GhiChu)
        {
            return da.MyExecuteNonQuery("Pro_Update_dmdiple", CommandType.StoredProcedure, ref err, new SqlParameter("@madiple", Madl), new SqlParameter("@tendiple", Tendl), new SqlParameter("@ghichu", GhiChu));
        }
        public object layma(ref string err, string str)
        {
            return da.lay(str, CommandType.Text, ref err);
        }
    }
}
